package edu.hawaii.ics414.blackjack.player;

import edu.hawaii.ics414.blackjack.card.Card;

/**
 * The user player.
 * 
 * @author Branden Ogata
 *
 */

public class Player extends Seat
{
  /**
   * Creates a new Player.
   * 
   * @param money The int equal to the amount of money that the new Player starts with.
   * 
   */
  
  public Player(int money)
  {
    this.hands = new Card[4][5];
    this.stands = new boolean[4];
    this.bets = new int[4];
    this.lastBet = new int[4];
    this.money = money;
  }
  
  /**
   * Returns a String representation of the hands for this Player.
   * This should show all of the cards to the player.
   * 
   * @return desc A String representing the cards that this Player has.
   * 
   */
  
  @Override
  public String getCards()
  {
    String desc = "";
    int i = 0;
    // For each hand
    for (Card[] hand : this.hands)
    {
      //prints the value and bet for the hand as well.
      if (hand[0] != null)
      {
        desc += "(Bet: ";
        desc += this.getBet(i);
        desc += ") ";
        desc += "Hand ";
        desc += (i + 1);
        desc += ": (Value: ";
        desc += handValue(i);
        desc += ")  -  ";
      }
      // Add each card to the String
      for (Card card : hand)
      {
        if (card != null)
        {
          desc += card + " ";
        }
      }
      
      if (hand[0] != null)
      {
        desc += "\n";
      }
      i++;
    }
    
    return desc;
  }
}